home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 40
/
Aminet 40 (2000)(Schatztruhe)[!][Dec 2000].iso
/
Aminet
/
misc
/
emu
/
ATUtilities.lha
/
ATUtilities
/
M2
/
MOUSE.MOD
< prev
next >
Wrap
Text File
|
2000-09-26
|
1KB
|
77 lines
(*$S- *)
IMPLEMENTATION MODULE Mouse;
FROM SYSTEM IMPORT BYTE,WORD,ADDRESS,ASSEMBLER;
FROM GEM IMPORT GDOSPtr,gdos,SystemMessagePtr,MouseButtonSet;
FROM System IMPORT AX,BX,CX,DX,ES,DS,SI,DI,Trap,GetVector;
PROCEDURE CheckMouse() : BOOLEAN;
VAR maus : ADDRESS;
BEGIN
GetVector(033H,maus);
IF (maus=NIL) THEN
RETURN(FALSE);
END (* IF *);
AX := 0;
Trap(033H);
IF (AX=0) THEN
RETURN(FALSE);
END (* IF *);
RETURN(TRUE);
END CheckMouse;
PROCEDURE MouseOn();
BEGIN
IF (gdos^.mouseLock=0) THEN
AX := 1;
Trap(033H);
END (* IF *);
gdos^.mouseLock := gdos^.mouseLock + 1;
END MouseOn;
PROCEDURE MouseOff();
BEGIN
IF (gdos^.mouseLock=1) THEN
AX := 2;
Trap(033H);
END (* IF *);
gdos^.mouseLock := gdos^.mouseLock - 1;
END MouseOff;
PROCEDURE WaitForKey();
BEGIN
AX := 0;
Trap(016H);
END WaitForKey;
PROCEDURE WaitForClick();
VAR buttons : CARDINAL;
BEGIN
REPEAT
AX := 3;
Trap(033H);
UNTIL (BX<>0);
REPEAT
AX := 3;
Trap(033H);
UNTIL (BX=0);
END WaitForClick;
PROCEDURE GetMouseData(msg : SystemMessagePtr);
VAR buttons : MouseButtonSet;
x,y : CARDINAL;
BEGIN
ASM
MOV AX,3
INT 33H
MOV x,CX
MOV y,DX
MOV buttons,BX
END (* ASM *);
msg^.mouseX := x;
msg^.mouseY := y;
msg^.mouseButtons := buttons;
END GetMouseData;
END Mouse.